package praktikumid.w05.p4;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CompareDates {

	public static void main(String[] args) {

		if (args.length != 2) {
			help();
		}
		
		//2013-09-12T12:55:12.123Z
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
		try {
			Date d1 = sdf.parse(args[0]);
			Date d2 = sdf.parse(args[1]);
			
			if (d1.before(d2)) {
				System.out.println("date1 < date2");
			} else {
				System.out.println("date1 >= date2");
			}
		} catch (ParseException e) {
			System.out.println("dates should be in format 2013-09-12T12:55:12.123Z");
			help();
		}
	}
	
	public static void help() {
		System.out.println("usage: program date1 date2");
		System.exit(0);
	}

}
